//
//  PostBaseView.m
//  PostDelivery
//
//  Created by wmz on 2020/6/20.
//  Copyright © 2020 wmz. All rights reserved.
//

#import "PostBaseView.h"
@interface PostBaseView()
/// 手势识别器
@property (nonatomic, strong) UITapGestureRecognizer *hd_tapRecognizer;

@end

@implementation PostBaseView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (void)hd_bindViewModel {
}

- (void)hd_setupViews {
}


- (void)commonInit {
    [self hd_setupViews];
    [self hd_bindViewModel];
    [self setNeedsUpdateConstraints];
}

- (UITapGestureRecognizer *)hd_tapRecognizer {
    if (!_hd_tapRecognizer) {
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
        tap.numberOfTapsRequired = 1;
        tap.numberOfTouchesRequired = 1;
        [tap addTarget:self action:@selector(hd_clickedViewHandler)];
        tap.cancelsTouchesInView = false;
        _hd_tapRecognizer = tap;
    }
    return _hd_tapRecognizer;
}

//- (void)dealloc {
//    [NSNotificationCenter.defaultCenter removeObserver:self];
//}

@end
